using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;


namespace MemoryGame
{
    public class StateHowToPlay : DEF
    {


        //public static String  textContent = "You have to find the pairs of the same card and the path between two the characters must have a maximun of three lines";
        public static Texture2D bitmapHowToplay;
        public static void SendMessage(int type)
        {

            switch (type)
            {
                case MESSAGE_CTOR:
                    bitmapHowToplay = Game1.contentManager.Load<Texture2D>("image//howtoplay");


                    break;
                case MESSAGE_UPDATE:

                    if (InputState.misbackkeyPress || InputState.isTouchReleaseInRect(DEF.SCREEN_WIDTH - DEF.BUTTON_CANCEL_CONFIRM_W, 0, DEF.BUTTON_CANCEL_CONFIRM_W, DEF.BUTTON_CANCEL_CONFIRM_H))
                    {
                        SoundManager.playSound(SoundManager.SOUND_BACK);
                        //	if (StateGameplay.isIngame)
                        //		changeState(STATE_IGM, true, true);
                        //	else
                        Game1.changeState(Game1.STATE_MAINMENU, true, true);
                    }
                    break;
                case MESSAGE_PAINT:
                    //	if (!StateGameplay.isIngame) {

                    //mainCanvas.drawBitmap(StateMainMenu.splashBitmap, matrix, mainPaint);
                    Game1.spriteBatch.Draw(bitmapHowToplay, new Vector2(0, 0), null, Color.White, 0f, new Vector2(0, 0), new Vector2(Game1.SCALE_X, Game1.SCALE_Y), SpriteEffects.None, 1);
                    //	} else {
                    //	StateGameplay.SendMessage(MESSAGE_PAINT);
                    //}

                    if (InputState.isTouchDrapInRect(DEF.SCREEN_WIDTH - DEF.BUTTON_CANCEL_CONFIRM_W, 0, DEF.BUTTON_CANCEL_CONFIRM_W, DEF.BUTTON_CANCEL_CONFIRM_H))
                        Game1.spriteBatch.Draw(texttureButtonMenu[DEF.FRAME_CANCEL_NORMAL], new Vector2(DEF.SCREEN_WIDTH - DEF.BUTTON_CANCEL_CONFIRM_W, 0), null, Color.White, 0f, new Vector2(0, 0), new Vector2(Game1.SCALE_X, Game1.SCALE_Y), SpriteEffects.None, 1);
                    else
                        Game1.spriteBatch.Draw(texttureButtonMenu[DEF.FRAME_CANCEL_NORMAL], new Vector2(DEF.SCREEN_WIDTH - DEF.BUTTON_CANCEL_CONFIRM_W, 0), null, Color.White, 0f, new Vector2(0, 0), new Vector2(Game1.SCALE_X, Game1.SCALE_Y), SpriteEffects.None, 1);
                    //    Game1.spriteDPad.drawAFrame(Game1.mainCanvas, DEF.FRAME_CANCEL_NORMAL, 0, 0);
                    break;
                case MESSAGE_DTOR:
                    break;
            }
        }
    }
}
